package com.ssy.lingxi.after.sale.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 售后退货发货商品
 * @author 伍将
 * @date 2020/9/17
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "as_return_delivery_goods_detail")
public class ReturnDeliveryGoodsDetailDO implements Serializable {
    private static final long serialVersionUID = -6460836066158280285L;

    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "return_delivery_goods_detail_seq")
    @SequenceGenerator(sequenceName = "as_return_delivery_goods_detail_seq", name = "return_delivery_goods_detail_seq", allocationSize = 1)
    private Long id;

    /**
     * 订单号
     */
    @Column(columnDefinition = "varchar(40)")
    private String orderNo;

    /**
     * 商品id
     */
    @Column(columnDefinition = "varchar(16)")
    private String productId;

    /**
     * 商品名称
     */
    @Column(columnDefinition = "varchar(90)")
    private String productName;

    /**
     * 品类
     */
    @Column(columnDefinition = "varchar(16)")
    private String category;

    /**
     * 品牌
     */
    @Column(columnDefinition = "varchar(20)")
    private String brand;

    /**
     * 单位
     */
    @Column(columnDefinition = "varchar(16)")
    private String unit;

    /**
     * 退货数量
     */
    @Column(columnDefinition = "decimal")
    private Double returnCount;

    /**
     * 发货数量
     */
    @Column(columnDefinition = "decimal")
    private Double deliveryCount;

    /**
     * 入库数量
     */
    @Column(columnDefinition = "decimal")
    private Double storageCount;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime;

    /**
     * 所属发货
     */
    @JsonBackReference
    @ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
    @JoinColumn(name = "delivery_id", referencedColumnName = "id")
    private ReturnDeliveryGoodsDO deliveryGoods;
    /**
     * 所属退货明细
     */
    @JsonBackReference
    @ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
    @JoinColumn(name = "return_detail_id", referencedColumnName = "id")
    private ReturnGoodsDetailDO returnGoodsDetailDO;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Double getReturnCount() {
        return returnCount;
    }

    public void setReturnCount(Double returnCount) {
        this.returnCount = returnCount;
    }

    public Double getDeliveryCount() {
        return deliveryCount;
    }

    public void setDeliveryCount(Double deliveryCount) {
        this.deliveryCount = deliveryCount;
    }

    public Double getStorageCount() {
        return storageCount;
    }

    public void setStorageCount(Double storageCount) {
        this.storageCount = storageCount;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public ReturnDeliveryGoodsDO getDeliveryGoods() {
        return deliveryGoods;
    }

    public void setDeliveryGoods(ReturnDeliveryGoodsDO deliveryGoods) {
        this.deliveryGoods = deliveryGoods;
    }

    public ReturnGoodsDetailDO getReturnGoodsDetailDO() {
        return returnGoodsDetailDO;
    }

    public void setReturnGoodsDetailDO(ReturnGoodsDetailDO returnGoodsDetailDO) {
        this.returnGoodsDetailDO = returnGoodsDetailDO;
    }
}
